//
//  DetailTableViewCell.m
//  Item A House
//
//  Created by 甄奇文 on 15/5/28.
//  Copyright (c) 2015年 lanou3g.com 蓝鸥科技. All rights reserved.
//

#import "DetailTableViewCell.h"

@implementation DetailTableViewCell
- (void)dealloc
{
    [_housefeature release];
    [super dealloc];
}

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.housefeature = [[UILabel alloc] initWithFrame:CGRectZero];
        // 初始行 为0;
        [self.housefeature setNumberOfLines:0];
        [self.contentView addSubview:self.housefeature];
    }
    return self;
}



- (void)layoutSubviews
{
    NSLog(@"%s", __func__);
    [super layoutSubviews];
    
    NSString *str = self.housefeature.text;
    NSDictionary *dic = @{NSFontAttributeName:[UIFont systemFontOfSize:17]};
    CGRect rect = [str boundingRectWithSize:CGSizeMake(200, 1000000) options:NSStringDrawingUsesLineFragmentOrigin attributes:dic context:nil];
    
    // 必须宽度一样大
    [self.housefeature setFrame:CGRectMake(10, 0, [UIScreen mainScreen].bounds.size.width - 10, rect.size.height)];
    
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
